-
Notifications
You must be signed in to change notification settings - Fork 846
Migrate jetpack_published_post to wp_after_insert_post hook #17838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…er_insert_post function is defined. Added to-do to cleanup wp_insert_post flow once 5.6 is the minimal supported version.
|
Scheduled Jetpack release: December 1, 2020. E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-17838 Thank you for the great PR description! When this PR is ready for review, please apply the |
|
Notes on Testing. The However it doesn't include cases where it should early return. We should have unit tests that manually calls |
|
Current E2E (All & with latest Gutenberg) Test Failure is a connection timeout unrelated to these changes. |
Testing is being done in test_sync_jetpack_published_post_no_action with a data provider that covers the above 4 cases. |
anomiex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code itself looks sane, and I see it has some tests which Travis is passing.
The instructions don't make it clear to me what I'm supposed to do manually, how do I "Verify jetpack_published_post action is queued and sent via Sync"? Should some instructions be being added to to-test.md for beta testers?
|
@kraftbj @jeherve, @anomiex what level of detail for testing do you think will be appropriate, does this deserve its own call to action for regression? Or should it be in the to-test instructions to verify posts are publicized to social media and that new posts show up in Search Results. Verifying 1 action triggers validates that the jetpack_published_post event is still being triggered. |
I think such detailed instructions for Beta testers would be nice, and we'll get folks to test with both 5.5 and 5.6. |
|
Sync Testing instructions have been outlined in https://github.com/Automattic/jetpack/pull/17772/files |
anomiex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemed to work using Jetpack's "Instant Search" as the testing method.
Note the code freeze is today, so if you want this in 9.2 you should get it merged ASAP.
|
Thanks for the review and feedback everyone. |
WP 5.6 introduces the new
wp_after_insert_postfunction and action that is triggered after a post and its terms, meta have been saved. We are migrating thejetpack_published_postsync event to this new hook to ensure that Publicize, Subscriptions and Elastic based functionality has the complete data available to it when they are triggered.Fixes #14629
Fixes #11752
See: https://core.trac.wordpress.org/changeset/49172
See: https://make.wordpress.org/core/2020/11/20/new-action-wp_after_insert_post-in-wordpress-5-6/
Changes proposed in this Pull Request:
jetpack_published_postsync event to trigger onwp_after_insert_postinstead ofwp_insert_post.Jetpack product discussion
Historically WP.com dependent Jetpack functionality has run into issues with race conditions or chunked sync event processing that has lead to Publicize, Subscription Emails, Related Posts, Search being triggered that does not contain the full terms and meta data. This missing data would in several cases have caused different flows in processing.
This migration to wp_after_insert_post allows us to ensure that publish actions have the full context of the post and its term/meta data so we are confidently triggering the proper action across all functionality.
Does this pull request change what data or activity we track or use?
No, the same content is being synced.
Testing instructions:
This change requires a full regression of functionality tied to
jetpack_published_postSpecific Instructions
Confirm jetpack_published_post is being sent in 5.6
Confirm jetpack_published_post is being sent still for versions less than 5.6
Note there are several methods to testing sync events. They are outlined at : PCYsg-svc-p2
Proposed changelog entry for your changes:
jetpack_published_postaction to new 5.6 hookwp_after_insert_post